Xbasic

Word_to_PDF Function

Syntax

function word_to_pdf as l (fndocx as c, fnpdf as c)

Arguments

fndocxCharacter

The full path to the input Word (.docx) file.

fnpdfCharacter

The full path where the output PDF file will be saved.

Returns

Logical

Returns `.t.` if the conversion is successful, otherwise returns `.f.`.

Description

Converts a Microsoft Word (.docx) file to a PDF file.

Discussion

This function checks if the input Word file exists before processing. If the file does not exist, it returns `.f.`.

Uses A5DocGen::FileMerge to generate the PDF.

dim success as l
         success = word_to_pdf("C:\path\to\document.docx", "C:\path\to\output.pdf")
         ? success